# Contributor: Lindsay Zhou <i@lin.moe>
# Maintainer: Lindsay Zhou <i@lin.moe>
pkgname=fcitx5-m17n
pkgver=5.1.1
pkgrel=0
pkgdesc="m17n extra input method support for fcitx5"
url="https://github.com/fcitx/fcitx5-m17n"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	cmake
	extra-cmake-modules
	gettext-dev
	fcitx5-dev
	fmt-dev
	m17n-lib-dev
	samurai
	"
subpackages="$pkgname-lang"
source="$pkgname-$pkgver.tar.gz::https://github.com/fcitx/fcitx5-m17n/archive/refs/tags/$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DENABLE_TEST="$(want_check && echo ON || echo OFF)"
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failre
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
af9aae6c43cc667b910f766cf251c6249573537cca855130e502370aa7ca028f3916d67b55d2596390df8c1de668228e81281a03e34ec5e9e00ab07d4d176839  fcitx5-m17n-5.1.1.tar.gz
"
